package com.example.demo.service;

import com.example.demo.dao.UserMapper;
import com.example.demo.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 12441
 */
@Service
public class UserService {
    @Autowired
    UserMapper userMapper;

    public List<User> findList() {
        return userMapper.list();
    }

    public int save(User user) {
        return userMapper.save(user);
    }

    public int delete(Integer id) {
        return userMapper.delete(id);
    }

    public int update(User user) {
        return userMapper.update(user);
    }

    public User findById(Integer id) {
        return userMapper.findById(id);
    }
}
